#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[])
{
	char str[1024];
	scanf("%s", str);

	int i, j, len = strlen(str);
	while (len % 2 == 0) {
		for (i = 0, j = len-1; i < len/2; i++, j--) {
			if (str[i] != str[j]) {
				printf("%d\n", len);
				return 0;
			}
		}
		len = len/2;
	}
	printf("%d\n", len);

	return 0;
}
